package com.ssm.util.test;

import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

public class Shuzi1 {

	public static void test1() {
		String aa="152";
		String bb="2254";
		
		String format = new DecimalFormat("0.00").format(new BigDecimal(aa).divide(new BigDecimal(bb), 2, RoundingMode.HALF_UP));
		System.out.println(format);
	}
	
	public static void main(String[] args) throws Exception {
		shufor();
	}
	
	public static void shufor() throws Exception {
		String str="";
		int aa=146912%100; //取余
		int bb=146912-aa;
		for (int i = 100; i < 146912; i=i+100) {
			str+="0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
			System.out.println(i);
			
			if (i==bb) {
				for (int j = 0; j < aa; j++) {
					str+="0";
					System.out.println(j);
				}
			}
			
		}
		
		File file = new File("D://shuzi.txt");
		FileOutputStream fos = new FileOutputStream(file);
		OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");
		osw.write(str);
		osw.flush();
		osw.close();
		
	}
	
	private static List<PublicSongBean> songMgrSortList = new ArrayList<>();
	
	private  MyComparator myComparator = new  MyComparator<PublicSongBean>();
	public  void test5() {
		
		Arrays.sort(songMgrSortList.toArray(),myComparator);
	}
	
	class MyComparator<T> implements Comparator<PublicSongBean> {
        @Override
        public int compare(PublicSongBean o1, PublicSongBean o2) {
            if (o1.getSerialNumber().compareTo(o2.getSerialNumber()) > 0) {
                return 1;
            }else if (o1.getSerialNumber().compareTo(o2.getSerialNumber()) < 0) {
                return -1;
            }else {
                return 0;
            }
        }
    }
}
